package org.example.pet.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.pet.dto.AdoptionApplyInfoDTO;
import org.example.pet.dto.AdoptionInfoResponseDTO;
import org.example.pet.dto.AdoptionPageQueryDTO;
import org.example.pet.pojo.AdoptionApplication;

import java.util.List;

@Mapper
public interface AdoptionApplicationMapper extends BaseMapper<AdoptionApplication> {
    /**
     * 查询领养分页数据列表
     */
    List<AdoptionInfoResponseDTO> queryAdoptionList(@Param("queryDTO") AdoptionPageQueryDTO queryDTO);

    /**
     * 查询领养数据总条数（用于计算总页数）
     */
    Long queryAdoptionCount(@Param("queryDTO") AdoptionPageQueryDTO queryDTO);

    AdoptionApplyInfoDTO getAdoptionApplyDetail(@Param("applicationId") Long applicationId);

    void updateStatusToRejected(Long applicationId);

    Integer countByDateAndStatus(String yesterdayStr);
}
